#include "Timer.h"

Timer::Timer(int interval)
:_interval(interval)
,_start(std::chrono::high_resolution_clock::now())
{
}
Timer::~Timer(){
}
bool Timer::isTimeout(){
    auto end = std::chrono::high_resolution_clock::now();
    return std::chrono::duration<double, std::milli>(end-_start).count() >= _interval;
}
void Timer::reset(){
   _start = std::chrono::high_resolution_clock::now();
}
